<?php
/**
 * Created by 1971599474@qq.com
 * User: zhixuan
 * Date: 2020/1/20
 * Time: 22:50
 */

namespace app\seller\controller;

use app\common\model\Shop as ShopModel;
use app\common\utils\JsonService;

class Shop extends Base
{
    public function update(){
        if($this->request->isAjax()){
            $post = $this->request->post();
            try {
                ShopModel::updateOne($post,['shop_id'=>$post['shop_id'],'member_id'=>$this->member_id]);
            } catch (\Exception $ex) {
                return JsonService::error($ex->getMessage());
            }
            return JsonService::success();
        }

        $shop = $this->shop;
        return $this->fetch('update',['shop'=>$shop]);
    }
}